function diff = u_fun( param)

    % Unemployment rate
    if param.s > 0
        diff= q_fun(param.m_l,param)./(q_fun(param.m_l,param)+(q_fun(param.m_u,param)-q_fun(param.m_l,param))/param.s);
    else
        sep = param.zeta + param.sigma^2./2./(1-param.alpha).*param.m_l.*q_p_fun(param.m_l,param)./(q_fun(param.m_u,param)-q_fun(param.m_l,param));
        diff = sep./(sep+param.lambda);
    end

end

